import request from '../utils/request.js'
// 面经接口
export const getarticle = (obj) => {
  return request.get('/interview/query', {
    params: {
      current: obj.current || 1,
      pageSize: obj.pageSize || 10,
      sorter: obj.sorter
    }
  })
}

// 详情接口
export const getdetail = (id) => {
  return request.get('/interview/show', {
    params: {
      id
    }
  })
}
// 喜欢接口
export const getlike = (id) => {
  return request.post('/interview/opt', {
    id,
    optType: 1 // 喜欢
  })
}
//  页面喜欢的接口
export const like = (obj) => {
  return request.get('/interview/opt/list', {
    params: {
      optType: 1,
      pageSize: 5,
      page: obj.page
    }
  })
}

// 收藏接口
export const getcollect = (id) => {
  return request.post('/interview/opt', {
    id,
    optType: 2 // 喜欢
  })
}
//  页面收藏的接口
export const collect = (obj) => {
  return request.get('/interview/opt/list', {
    params: {
      optType: 2,
      pageSize: 5,
      page: obj.page
    }
  })
}
